<?php $this->headScript()->captureStart() ?>
$(document).ready(function(){
    var options = { 
        type:"POST",
        dataType : "text",
        buttons:$('#domainForm').find("button[name='button']"),
        async : true,
        cache: false,
        success:function(responseText, statusText)
        {
            var json = jQuery.parseJSON(responseText);
            if(json.result != 1){
                dialogMessage(json.messages);
                //$('#registerForm').find(".captcha").reloadCaptcha();
                return false;
            }
            
            dialogTip(json.messages, function(){
                window.location.reload();
            });
            return true;
        },
    };
    var v = jQuery("#domainForm").validate({
        debug: true,
        messages: {
            domain: {
                required: "<?php echo $this->translate("Please enter a domain.");?>",
            },
        },
        rules: {
            domain: {
                required: true,
            },
        },
        
        success: function(label) {
            label.addClass("valid").text("Ok!");
        },
        submitHandler: function(form) {
            jQuery(form).ajaxSubmit(options);
        }
    });
});
<?php $this->headScript()->captureEnd() ?>

<div class="container">
    <div class="column span-18 colborder">
        <?php if(!$this->domain):?>
        <form method="post" id="domainForm" name="domainForm" action="<?php echo $this->url(array('module'=>'setup', 'controller'=>'domain', 'action'=>'save-post'),'default',true) ?>">
        <div class="prepend-top">
            <?php echo $this->preUrl;?><input type="text" name="domain" id="domain" value="" validate="{required:true}">
        </div>
        <div class="prepend-top"><input type="submit" name="submit" id="submit" value="Submit"></div>
        </form>
        <?php else:?>
        <div class="prepend-top">
            <p><dfn><?php echo $this->preUrl;?><?php echo $this->domain;?></dfn></p>
        </div>
        <?php endif;?>
    </div>
    <div class="column span-5 last">
       <?php echo $this->render('module_setup_script_sidebar.phtml');?>
    </div>
</div>

<script type="text/javascript">

</script>